package cn.kiliter.web.servlet;

import cn.kiliter.model.Order;
import cn.kiliter.serviece.OrderService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/orderinfo")
public class orderifoServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        String orderid = request.getParameter("orderid");
        OrderService service=new OrderService();
        Order order=service.findOrderInfoByID(orderid);
        request.setAttribute("order",order);
        request.getRequestDispatcher("/orderInfo.jsp").forward(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }
}
